﻿using BCDto.TMS.Contraband.ContrabandConfig;
using BCService.TMS.Contraband.ContrabandConfig;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BCTMSRESTful.Controllers.ClientApp.Contraband
{
    /// <summary>
    /// 违禁品配置
    /// </summary>
    [Route("api/v1/ClientApp/[controller]")]
    [ApiExplorerSettings(GroupName = "ClientApp")]
    [AllowAnonymous]
    public class ContrabandConfigController : ClientAppBaseController
    {
        private readonly IContrabandConfigService contrabandConfigService;

        public ContrabandConfigController(IContrabandConfigService contrabandConfigService)
        {
            this.contrabandConfigService = contrabandConfigService;
        }

        /// <summary>
        /// 获取违禁品配置列表
        /// </summary>
        /// <param name="contrabandCategoryId">违禁品分类Id</param>
        /// <response code="200">获取违禁品配置列表</response>
        /// <returns></returns>
        [HttpGet("[action]")]
        [ProducesResponseType(typeof(IEnumerable<ContrabandConfigDto>), 200)]
        public IActionResult List([FromQuery(Name = "contraband_category_id")] int? contrabandCategoryId)
        {
            var result = this.contrabandConfigService.GetList(contrabandCategoryId);
            return this.Ok(result);
        }
    }
}
